/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.himaci.gtbattle.view;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector3;
import com.himaci.framework.BaseScreen;
import com.himaci.gtbattle.GTBattle;
import com.himaci.gtbattle.resource.Assets;

/**
 *
 * @author XNPSDN
 */
public class AboutScreen extends BaseScreen {

    Vector3 touchPoint;
    Rectangle back;

    public AboutScreen(Game game) {
	super(game);
	touchPoint = new Vector3();
	back = new Rectangle(480 - 80, 0, 80, 60);
    }

    @Override
    public void update(float deltaTime) {
	if (Gdx.input.justTouched()) {
	    camera.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0));
	    if (back.contains(touchPoint.x, touchPoint.y)) {
		game.setScreen(GTBattle.mainMenuScreen);
	    }
	}
    }

    @Override
    public void present(float deltaTime) {
	Gdx.gl.glClearColor(Color.WHITE.r, Color.WHITE.g, Color.WHITE.b, 1);
	Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

	camera.update();
	batcher.setProjectionMatrix(camera.combined);

	batcher.disableBlending();
	batcher.begin();
	batcher.draw(Assets.getInstance().about, 0, 0);
	batcher.end();
    }

    @Override
    public void resize(int width, int height) {
    }

    @Override
    public void show() {
    }

    @Override
    public void hide() {
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }

    @Override
    public void releaseResource() {
    }
}
